<!--{include(file='selhead.html')}-->
<script src="template/jslib/country/country.js" type="text/javascript"></script>
											
<div id="wrap">
	<div style="padding:0 20px 20px;">
		<div id="main_c">
			<div id="infotab" style="line-height:28px;text-align:center;font-size:14px;font-weight:bold;">
				打印快递单
			</div>

			<form action="<!--{url('admin','trade','tradeoper','opertype=ptexpress')}-->" method="post" name="submitform" id="submitform">
			<div id="fororder" class="bk">
					<ul class="bk_1 clearfix">
						<li>
							<table class="tableStyle" cellspacing="0" cellpadding="0" border="0">
								<thead>
									<tr>
										<th colspan="2">收货信息</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td width="10%">收货人姓名：</td>
										<td align="left">
											<input type="text" value="<!--{$trade.receiver_name}-->" name="receiver" id="receiver" />
										</td>
									</tr>
									<tr>
										<td width="10%">地区：</td>
										<td align="left">
											<select name="province" id="province" onchange="$.country.getCity()" autocomplete="off">
												<!--{$provinceopt}-->
											</select>
											-
											<select name="city" id="city" onchange="$.country.getDistrict()" autocomplete="off">
												<!--{$cityopt}-->
											</select>
											-
											<select name="district" id="district" onchange="$.country.getZip()" autocomplete="off">
												<!--{$districtopt}-->
											</select>
										</td>
									</tr>
									<tr>
										<td>详细地址：</td>
										<td><input type="text" value="<!--{$trade.receiver_address}-->" name="address" id="address" size="40" /></td>
									</tr>
									<tr height="30">
										<td>邮编：</td>
										<td><input type="text" value="<!--{$trade.receiver_zip}-->" name="zipcode" id="zipcode" />
											<script type="text/javascript">
												$.country.init(false);
											</script>
										</td>
									</tr>
									<tr height="30">
										<td>电话/手机：</td>
										<td><input type="text" value="<!--{$trade.receiver_link}-->" name="link" id="link" /></td>
									</tr>
									<tr height="30">
										<td colspan="2">
											修改收货信息后，您可以 <input type="button" value="保存订单地址" onclick="savereceiver('<!--{$trade.tradeid}-->')"/>
											<span class='state_tip' style="float:none;"></span>
										</td>
									</tr>
									<script type="text/javascript">
										function savereceiver(tradeid) {
											var postdata = {
												name:$.trim($('#receiver').val()),
												province:$.trim($("#province").val()),
												city:$.trim($("#city").val()),
												district:$.trim($("#district").val()),
												address:$.trim($("#address").val()),
												zipcode:$.trim($("#zipcode").val()),
												link:$.trim($("#link").val()),
												tradeid:tradeid
											};
											$.util.show();
											$.post("<!--{url('admin','trade','tradeoper','opertype=savereceiver')}-->",postdata,function(data){
												$.util.hide();
												if(data == "success") {} 
												else {
													jAlert(data);
												}
											})
										}
									</script>
								</tbody>
							</table>
						</li>
						<li>
							<table class="tableStyle" cellspacing="0" cellpadding="0" border="0">
								<thead>
									<tr>
										<th width="20%">
											发货信息选择：
			<select onchange="window.location.href='<!--{url('admin','trade','tradeoper','opertype=ptexpress&tradeid=$trade[tradeid]')}-->&addrid='+this.value" name="addrid">
				<!--{foreach $addrlist addr}-->
					<option value="<!--{$addr.addrid}-->"
						<!--{if $addr[addrid] == $curaddr['addrid']}-->selected<!--{/if}-->
					><!--{$addr.linkman}--></option>
				<!--{/foreach}-->
			</select>
										</th>
										<th>发货信息</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td width="10%">联系人：</td>
										<td><!--{$curaddr.linkman}--></td>
									</tr>
									<tr>
										<td width="10%">地区：</td>
										<td>
											<!--{getDistrict($curaddr.province,$curaddr.city,$curaddr.district)}--> <!--{$curaddr.address}-->
										</td>
									</tr>
									<tr>
										<td width="10%">手机/电话：</td>
										<td>
											<!--{$curaddr.link}-->
										</td>
									</tr>
									<tr>
										<td width="10%">邮编：</td>
										<td>
											<!--{$curaddr.zipcode}-->
										</td>
									</tr>
								</tbody>
							</table>
						</li>
					</ul>
				
					<div class="bt_bk2">
								<!--{foreach $tpllist tpl}-->
								<a href="javascript:void(0);" class="btn" onclick="jssubmit('<!--{$tpl.tplid}-->');return false;"><span><!--{$tpl.name}--></span></a>
								<!--{/foreach}-->
								<input type="hidden" value="<!--{$trade.tradeid}-->" name="tradeid" id="tradeid"/>
								<input type="hidden" value="" name="tplid" id="tplid"/>
					</div>
			</div>
	</form>
		</div>
		<b class="b4b"></b><b class="b3b"></b><b class="b2b"></b><b class="b1b"></b>
	</div>
</div>
</body>
</html>
<script type="text/javascript">
function jssubmit(tplid) {
	$("#tplid").val(tplid);
	$.oper.submit();
}
</script>


